//
//  LSZMyCollectionManager.m
//  JKFuYinProject
//
//  Created by 九酷 on 2017/10/12.
//  Copyright © 2017年 LC. All rights reserved.
//

#import "LSZMyCollectionManager.h"

@implementation LSZMyCollectionManager
-(id)initWithMyCollectionManager:(NSDictionary *)dic
{
    self = [super init];
    if (self) {
        self.mutDataArray = [NSMutableArray array];
        if ([[dic valueForKey:@"data"] isKindOfClass:[NSString class]]) {
            return self;
        }
        if ([[dic valueForKey:@"data"] isKindOfClass:[NSNumber class]]) {
            return self;
        }
        if (![dic valueForKey:@"data"]) {
            return self;
        }
        NSArray * arrayData = dic[@"data"];
        NSMutableArray * mutArray = [[NSMutableArray alloc]init];
        for (NSDictionary * diction in arrayData) {
            LSZCollectionMg * collection = [[LSZCollectionMg alloc]init];
            NSString * string = NullStringjudgment(NSStr(diction[@"add_time"]));
            if(string.length >10){
                collection.addtime = [string substringToIndex:10];
            }else{
                collection.addtime = string;
            }
            collection.content = NullStringjudgment(NSStr(diction[@"relation"]));
            collection.id_id   = NullStringjudgment(NSStr(diction[@"id"]));
            collection.title   = NullStringjudgment(NSStr(diction[@"title"]));
            if ([diction valueForKey:@"input"]) {
                collection.input = NullStringjudgment(NSStr(diction[@"input"]));
            }
            [mutArray addObject:collection];
        }
        self.mutDataArray = mutArray;
    }
    return self;
}

@end
@implementation LSZCollectionMg
@end
